﻿<UserControl x:Class="Notoric.Gui.Controls.Section"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vme="clr-namespace:Notoric.ViewModel.Elements;assembly=ViewModel"
             xmlns:adrns="clr-namespace:Notoric.Gui.Controls.Adorners"
             xmlns:me="clr-namespace:Notoric.Gui.Controls"
             DataContextChanged="UserControl_DataContextChanged"
             >
    <Canvas>
        <adrns:RRMDecorator x:Name="main" Canvas.Left="{Binding Path=Left, Mode=TwoWay}" Canvas.Top="{Binding Path=Top, Mode=TwoWay}"
                            Height="{Binding Path=Height, Mode=TwoWay}" Width="{Binding Path=Width, Mode=TwoWay}"
                            ShowDecorator="{Binding Path=IsSelected, Mode=OneWay}"
                            MoveCompleted="RRMDecorator_MoveCompleted"
                            ResizeCompleted="RRMDecorator_ResizeCompleted"
                            RotateCompleted="RRMDecorator_RotateCompleted">
            <Border Background="{Binding Path=Background, Mode=OneWay}" BorderBrush="{Binding Path=BorderBrush, Mode=OneWay}" BorderThickness="{Binding Path=BorderThickness, Mode=OneWay}"
                                Margin="{Binding Path=Margin, Mode=OneWay}" MouseLeftButtonDown="Border_MouseLeftButtonDown">
                <ContentControl Content="{Binding Path=Interior, Mode=OneWay}" IsEnabled="{Binding IsSelected, Mode=OneWay}"/>
            </Border>
            <adrns:RRMDecorator.RenderTransform>
                <RotateTransform Angle="{Binding Path=RotationAngle, Mode=TwoWay}"/>
            </adrns:RRMDecorator.RenderTransform>
        </adrns:RRMDecorator>
    </Canvas>
</UserControl>
